package com.itheima.zuoye2.zuoye3;

import java.util.Scanner;

class Test {
 static void payMoney( Card  card) {
        Scanner sc = new Scanner(System.in);
//        键盘输入支付金额
        System.out.println("请输入支付金额：");
        double amount = sc.nextDouble();
        card.pay(amount);

    }

    public static void main(String[] args) {
//        创建金卡
         GoldCard goldCard = new GoldCard("123456789", "张三", "13800000001", 1000.00);


//        创建银卡
        SilverCard silverCard = new SilverCard("S001", "李四", "13888888888", 1000.00);
        System.out.println("请选择支付方式：1.金卡支付  2.银卡支付");
        Scanner chose = new Scanner(System.in);
        int chose1 = chose.nextInt();
        switch (chose1) {
            case 1:
               payMoney(goldCard);
                break;
            case 2:
                payMoney(silverCard);
                break;
            default:
                System.out.println("输入错误！");
        }


    }





}
